feat: migrate to agent-core build_agent API with provider config#21
Merged
Conversation
Align with upstream agent-core's new modular layout: drop the direct
OpenAIAgent coupling in favor of build_agent, which dispatches on
provider.type (openai or anthropic). This unlocks Claude support and
matches the agentic-discord-bot migration.
- app.py: use build_agent + agent_config.json (was OpenAIAgent.from_dict
+ servers_config.json)
- bot/config.py: inline env_flag (agent_core.env was removed upstream)
and switch default config schema to {"mcp": {}}
- bot/telegram.py: rename openai_agent constructor arg to agent, type as
AIAgent, and surface AgentError with provider/subtype/session logging
- New agent_config.example.json using opencode-style schema
(provider block + mcp with type: local/remote)
- README.md rewritten for the new provider/MCP schema, Claude section,
and docker-compose/run.sh
- Dockerfile: add curl/git/jq for MCP server tooling
- Added docker-compose.yml and run.sh mirroring the discord layout
- pyproject.toml: move agent-core dep to tool.uv.sources
- Update tests to new schema and agent kwarg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
OpenAIAgent.from_dictwithbuild_agent, which dispatches onprovider.type(openai|anthropic). Unlocks Claude support and aligns with theagentic-discord-botmigration.servers_config.json→agent_config.jsonwith the new opencode-style schema (providerblock +mcpentries keyed bytype: local | remote).env_flaginbot/config.py(upstream removedagent_core.env).openai_agentconstructor arg toagentand surfaceAgentErrorwithprovider/subtype/session_idlogging.docker-compose.ymlandrun.sh; hardenDockerfilewithcurl git jqfor MCP server tooling..gitignore, README, and tests to the new schema.Test plan
uv run ruff check .uv run ty checkuv run pytest(107 passed)docker compose up -d --buildwith a real token andagent_config.json, verify private + group chat flowsNotes
If a previous
uv syncproduced a staleagent-corelayout, clear the cache and regenerate the lockfile: